Practical Declarative Debugging of Mercury Programs
نویسنده
چکیده
Debugging is the most unpredictable and potentially expensive phase of the software development life-cycle. Declarative debuggers ask the user questions about the correctness of subcomputations in their program. Based on the user’s answers, subcomputations that cannot be the cause of the buggy behaviour are eliminated. Eventually one subcomputation is left which must be the cause of the buggy behaviour. Declarative debuggers thus keep track of which parts of the computation are still suspect, relieving the user of the burden of having to do so. They also direct the bug search, something that many users (especially novices) would find difficult to do manually. Even expert users often find it hard to explore large search spaces systematically, a limitation that does not apply to software systems. Declarative debuggers thus have the potential to make the debugging process easier and much more predictable. Despite these expected benefits, declarative debugging is not yet widely used in practice to find real bugs. There are three main reasons for this: 1. Most previous declarative debuggers only support a subset of the features of their target language that is not sufficient to express real programs. 2. Previous declarative debuggers do not scale well when applied to problems with large search spaces. 3. Previous declarative debuggers do not do enough to make the questions easier for the user to answer. The declarative nature of Mercury makes it relatively easy to implement a declarative debugger that can handle the full language. The version of the Mercury declarative debugger that was the starting point for this thesis already handled almost all of Mercury. By extending it to handle exceptions we made it handle the full language One problem posed by large search spaces is that they cannot be stored in memory all at once. This requires only portions of the search space to be stored in memory at any one time, materializing missing pieces when they are needed by reexecuting the program. We present the first algorithm for controlling this rematerialization process that is practical in the presence of multiple search strategies, minimising reexecutions while keeping memory consumption within acceptable limits. Another problem with large search spaces is that previous search strategies either asked far too many questions, demanded too much in the way of CPU and/or memory resources
منابع مشابه
Debugging Prolog Programs Declaratively
Traditional declarative debuggers, despite their theoretical attractions are not considered to be practical tools for debugging of many Prolog programs. This is partly due to the fact that the basic declarative debugging system (Shapiro 83) only dealt with pure Prolog programs, and partly due to practical limitations of the suggested methods and algorithms. Our aim has been to study the applica...
متن کاملA Semantic Framework for the Declarative Debugging of Wrong and Missing Answers in Declarative Constraint Programming
Debugging tools are a practical need for helping programmers to understand why their programs do not work as intended. Declarative programming paradigms involving complex operational details, such as constraint solving and lazy evaluation, do not fit well to traditional debugging techniques relying on the inspection of low-level computation traces. As a solution to this problem, and following a...
متن کاملDebugging ASP Programs by Means of ASP
Answer-set programming (ASP) has become an important paradigm for declarative problem solving in recent years. However, to further improve the usability of answer-set programs, the development of software-engineering tools is vital. In particular, the area of debugging provides a challenge in both theoretical and practical terms. This is due to the purely declarative nature of ASP that, on the ...
متن کاملDebugging for a Declarative Programming Language
This paper investigates debugging in declarative programming languages, concentrating specifically on the integrated functional and logic programming language Escher. The Escher language has types and modules, higher-order and meta-programming facilities, and declarative input/output. It also has a collection of system modules, providing numerous operations on standard data types such as intege...
متن کاملUsing Global Analysis, Partial Speciications, and an Extensible Assertion Language for Program Validation and Debugging
We present a framework for the application of abstract interpretation as an aid during program development, rather than in the more traditional application of program optimization. Program validation and detection of errors is rst performed statically by comparing (partial) speciications written in terms of assertions against information obtained from static analysis of the program. The results...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005